<?php
include "../../../lib/list.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head>
<link rel="stylesheet" href="../../../css/list.css" type="text/css"></link>
<link rel="stylesheet" href="../../../css/table.blue.sorter.css"
	type="text/css" media="print, projection, screen"></link>
<link rel="stylesheet" href="../../../css/jquery.tablesorter.pager.css"
	type="text/css" media="print, projection, screen"></link>
<script type="text/javascript" src="../../../js/jquery-1.2.6.js"></script>
<script type="text/javascript" src="../../../js/list.js"></script>
</head>
<body style="padding: 0; margin: 0; overflow-x: hidden;">
	<table cellspacing="1" class="tablesorter"
		style="padding: 0; margin: 0;">
		<tbody>
			
			
		<?php
		if($mode=='search'){
			$barcode = $_POST['barcode'];
			$name = $_POST['name'];
			$namegana = $_POST['namegana'];
			$bigcategory = $_POST['bigcategory'];
			$middlecategory = $_POST['middlecategory'];
			$smallcategory = $_POST['smallcategory'];
			$bumun = $_POST['bumun'];
			$buyer = $_POST['buyer'];

			if($barcode){
				$sear_char .= " and barcode like '%$barcode%' ";
			}
			if($name){
				$sear_char .= " and productname like '%$name%' ";
			}
			if($namegana){
				$sear_char .= " and productnamegana like '%$namegana%' ";
			}
			if($bumun){
				$sear_char .= " and bumun_no = '$bumun' ";
			}
			if($buyer){
				$sear_char .= " and buyer = '$buyer' ";
			}
			if($bigcategory!='-1'&&$bigcategory){
				$sear_char .= " and b_no = $bigcategory ";
			}
			if($middlecategory!='-1'&&$middlecategory){
				$sear_char .= " and m_no = $middlecategory ";
			}
			if($smallcategory!='-1'&&$smallcategory){
				$sear_char .= " and s_no = $smallcategory ";
			}
			
			$query = "select * from uatp_product where 1 AND stock = '1' $sear_char order by no DESC LIMIT 0, 100";
			$result = DBquery($query);
			for($i=1; $list = mysql_fetch_array($result); $i++){
				?>
			<tr>
				<td
					onclick="parent.product('<?=$list[no]?>','<?=$list[productname]?>','<?=$list[price1]?>','<?=$list[barcode]?>');FocusColor2(this);">
					<div style="width: 200px; float: left;">
					<?=$list['barcode']?>
					</div>
					<div style="width: 200px; float: left;">
						<b><?=$list['productname']?> </b>
					</div></td>
			</tr>
			
			
			
			
<?php 
}
	mysql_free_result($result);
						}else{
?>
				<tr>	
						<td style='text-align:center;height:154px;padding-top:20px'>
						검색 조건이 입력되지 않았습니다.
						<br></br>검색조건을 이용하여 상품을 검색해주세요.
						<br></br><font color=#0078a5>** 상품은 총 100개 까지만 검색이 가능하며
						<br></br>상품마스터에서 재고관리를 선택하지 않은 제품은 
						<br></br>표시되지 않습니다.</font>
						</td>
				</tr>
<?php }?>
			</tbody>
	</table>
</body>
</html>
